﻿<UserControl x:Class="MyAdressBookWPF.View.ContactView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" FontFamily="Tahoma" FontSize="13.333" Foreground="#FF7C7C7C" 
             >
    <Grid MinWidth="640" MinHeight="480">
        <ListBox ItemsSource="{Binding ContactsList}" ScrollViewer.CanContentScroll="True" HorizontalAlignment="Left" 
                 Name="listBox1" VerticalAlignment="stretch" Width="200" BorderBrush="#FF7C7C7C"
                 SelectedItem="{Binding SelectedContact}" Foreground="#FF7C7C7C" BorderThickness="0,0,1,0">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition></ColumnDefinition>
                            <ColumnDefinition></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding ContactName}" Margin="2, 2, 5, 0" HorizontalAlignment="Stretch"></TextBlock>
                        <TextBlock  Grid.Column="1" Text="{Binding ContactFirstName}" Margin="0, 2, 10, 0" HorizontalAlignment="Stretch"></TextBlock>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Label Content="Tel" RenderTransformOrigin="6.87,1.002" VerticalAlignment="Top" Margin="204,140.279,0,0" HorizontalAlignment="Left" Width="114.993" Foreground="#FF7C7C7C"/>
        <Label Content="Address" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="204,94.186,0,0" Width="114.993" Foreground="#FF7C7C7C"/>
        <Label Content="FirstName" VerticalAlignment="Top" Margin="204,48.093,0,0" HorizontalAlignment="Left" Width="114.993" Foreground="#FF7C7C7C"/>
        <Label Content="Name" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="204,2,0,0" Width="114.993" Foreground="#FF7C7C7C"/>
        <TextBox HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding ContactName}" VerticalAlignment="Top" Margin="0,4,40.447,0" Width="276.56" Foreground="#FF7C7C7C"/>
        <TextBox HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding ContactFirstName}" VerticalAlignment="Top" Margin="0,50.093,40.447,0" Width="276.56" Foreground="#FF7C7C7C"/>
        <TextBox HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding ContactAddress}" VerticalAlignment="Top" Margin="0,96.186,40.447,0" Width="276.56" Foreground="#FF7C7C7C"/>
        <TextBox HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding ContactTel}" VerticalAlignment="Top" Margin="0,142.279,40.447,0" Width="276.56" Foreground="#FF7C7C7C"/>
        <Button Content="Save" IsEnabled="{Binding SaveCommandIsEnabled}" Command="{Binding SaveCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="75" Margin="0,179,132,0"/>
        <Button Content="Delete" IsEnabled="{Binding SaveCommandIsEnabled}" Command="{Binding DeleteCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="75" Margin="0,179,40.447,0"/>
        <Button Content="Cleanse" Command="{Binding CleanseCommand}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="75" Margin="0,179,242.007,0"/>
    </Grid>
</UserControl>
